package com.chen.retry;

import org.apache.commons.lang3.RandomUtils;

/**
 *
 * @author chen
 *
 */
public class RetryDemoTask {


    public static boolean retryTask(String param){
        int i = RandomUtils.nextInt(0,11);
        System.out.println("参数："+param+"  随机数："+i);
        if(i==0){
            throw  new IllegalArgumentException("参数异常");
        } else if (i==1) {
            return true;
        } else if (i==2) {
            return false;
        }else{
            throw new RuntimeException("大于2 抛出一场");
        }
    }
}
